package com.object.oriented.exam.system5.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.object.oriented.exam.system5.entity.Answer;
import com.object.oriented.exam.system5.entity.Score;

import java.util.List;

/**
 * @author xdf
 * @date 2023-06-14
 */
public interface ScoreService {
  /**
   * 获取某个学生某次成绩
   * @param studnetId
   * @param examId
   * @return
   */
  Score getScore(Long studnetId, Long examId);

  /**
   * 分页获取某个学生所有成绩
   * @param studentId
   * @param examId
   * @param current
   * @param size
   * @return
   */
  Page<Score> getScores(Long studentId, Long examId, Long current, Long size);

  /**
   * 分页获取某次考试所有成绩（不指定学生）
   * @param examId
   * @param current
   * @param size
   * @return
   */
  Page<Score> getScoresInExam(Long examId, Long current, Long size);

  /**
   * 完成考试，更改状态,并自动对客观题评分
   * @param studentId
   * @param examId
   */
  Boolean finish(Long studentId, Long examId, List<Answer> answerList);

  /**
   *计算考试总分
   * @param studentId
   * @param examId
   * @return
   */
  Integer compute(Long studentId, Long examId);
}
